import Mouse
import Plot as Plot
import PlotData as PD
--import PlotData (Pos,defaultAxis,graph)


testAxis : PD.Axis 
testAxis = PD.Axis {tlc={x=0,y=400},
                    brc={x=1000,y=900},
                    b1=20,b2=20,b3=20,b4=20,
                    xAxis = ["0","1","2","3","4","5","6","7","8","9","10"],
                    yAxis = ["0","1","2","3","4","5"],
                    axisDecimalFun = PD.defaultAxisDecimalFun,
                    axisLines = solid red,
                    crossHair = True,
                    crossHairLines = dotted blue,
                    crossHairValueSpaceFun = floor
                   }
           
           
testAxis1 : PD.Axis 
testAxis1 = PD.Axis {tlc={x=1000,y=400},
                    brc={x=2000,y=900},
                    b1=20,b2=20,b3=20,b4=20,
                    xAxis = ["0","1","2","3","4","5","6","7","8","9","10"],
                    yAxis = ["0","1","2","3","4","5","6","7","8","9","10"],
                    axisDecimalFun = PD.defaultAxisDecimalFun,
                    axisLines = solid green,
                    crossHair = True,
                    crossHairLines = dotted red,
                    crossHairValueSpaceFun = floor
                   }






scene (x,y) = let pos = {px=(toFloat x),py=(toFloat y)}
                  collPos = Plot.screenPos2CollagePos testAxis pos
                  collPos1 = Plot.screenPos2CollagePos PD.defaultAxis pos
                  grPos = Plot.collagePos2GraphPos testAxis collPos
                  grPos1 = Plot.collagePos2GraphPos PD.defaultAxis collPos1
                  endPos = Plot.graphEndPos testAxis 
                  endPos1 = Plot.graphEndPos PD.defaultAxis
                  startPos = Plot.graphStartPos testAxis 
              in flow down [ Plot.createGraphScene PD.defaultAxis PD.graph pos, 
                             flow right [Plot.createGraphScene testAxis PD.graph pos,
                                         Plot.createGraphScene testAxis1 PD.graph pos
                                         ],
                             flow right [plainText "Mouse position", asText pos],
                             flow right [plainText "Collage Pos " , asText collPos,plainText " default " , asText collPos1],
                             flow right [plainText "graph Pos " , asText grPos, plainText " default " , asText grPos1 ],
                             flow right [plainText "End Pos " , asText endPos,plainText " default ", asText endPos1],
                             flow right [plainText "Start Pos " , asText startPos]
                             ]
                 
main = lift scene Mouse.position